package com.zhangkeyou.map.mapweb.mapper.handler;

import com.zhangkeyou.map.mapweb.domain.entity.Feature;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;

import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
@MappedJdbcTypes(JdbcType.BLOB)
//@MappedTypes(List.class)
public class FeaturesTypeHandler extends BaseTypeHandler<List<Feature>> {
    @Override
    public void setNonNullParameter(PreparedStatement preparedStatement, int i, List<Feature> features, JdbcType jdbcType) throws SQLException {
        preparedStatement.setNString(i,features.toString());
    }

    @Override
    public List<Feature> getNullableResult(ResultSet resultSet, String s) throws SQLException {
        String string = resultSet.getString(s);
        return null;
    }

    @Override
    public List<Feature> getNullableResult(ResultSet resultSet, int i) throws SQLException {
        String string = resultSet.getString(i);
        return null;
    }

    @Override
    public List<Feature> getNullableResult(CallableStatement callableStatement, int i) throws SQLException {
        String string = callableStatement.getString(i);
        return null;
    }
}
